package com.kotlin.zds.activity

import android.os.Bundle
import android.os.Handler
import android.view.LayoutInflater
import com.alibaba.android.arouter.facade.annotation.Route
import com.kotlin.zds.arouter.Routes
import com.kotlin.zds.base.BaseActivity
import com.kotlin.zds.bdtts.BaiDuTts
import com.kotlin.zds.databinding.ActivityBaiduvdBinding
import com.xuexiang.xui.utils.StatusBarUtils

/**
 * Author: zds
 * Date: 2022/11/6 21:49
 * Description: 百度语音在线合成播放
 * Version: v1.0
 */
@Route(path = Routes.PATH_BAIDU)
class BaiduVdActivity :BaseActivity(){
    var baiDuTts: BaiDuTts?=null
    val viewBinding by lazy {
        ActivityBaiduvdBinding.inflate(LayoutInflater.from(mActivity))
    }
    override fun onSetContentView() {
        setContentView(viewBinding.root)
        StatusBarUtils.initStatusBarStyle(this,false)
    }


    override fun initView() {
        baiDuTts = BaiDuTts()
        baiDuTts?.initTTs(this, Handler())
        viewBinding.run {
            viewBinding.btnSpeak.setOnClickListener {
                baiDuTts?.speak(viewBinding.edGjlx.text.toString())
            }
        }
    }

    override fun initData() {

    }

}